<?php
// We'll be outputting a PDF
header('Content-type: application/excel');

header('Content-Disposition: attachment; filename="'.$leg->getFlightCode().' export '.date('YMDhi').'.xls"');

?>
<table>
  <?php 

      $reservation_status_labels = array(
          'created'=>'New',
          'pending'=>'Payment pending',
          'validated'=>'Payment validated',
          'cancelled'=>'Cancelled',
      );
  ?>
  <?php foreach($passengers->getRawValue() as $passenger): ?>
  <tr>
    <td><?php echo $passenger['ticket_code']; ?></td>
    <td><?php echo $passenger['firstname']; ?></td>
    <td><?php echo $passenger['lastname']; ?></td>
    <td><?php echo $passenger['id_type']; ?></td>
    <td><?php echo $passenger['id_ref']; ?></td>
    <td><?php echo $passenger['civility']; ?></td>
    <td><?php echo $passenger['birthday']; ?></td>
    <td><?php echo $passenger['address']; ?></td>
    <td><?php echo $passenger['city']; ?></td>
    <td><?php echo $passenger['country']; ?></td>
    <td><?php echo $passenger['notes']; ?></td>
    <td><?php echo $passenger['reservation_ref']; ?></td>
    <td><?php echo $passenger['contact_email']; ?></td>
    <td><?php echo $passenger['contact_phone']; ?></td>
    <td>
    <?php 
      echo $reservation_status_labels[$passenger['reservation_status']] ;
    ?></td>
  </tr>
<?php endforeach; ?>
</table>
<?php

die();